package kr.hkit.androidcomplete03.ch22;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class Rotate extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));

	}

	protected class MyView extends View {
		// 생성자 생성
		public MyView(Context context) {
			super(context);
		}

		// 그리기 함수
		public void onDraw(Canvas canvas) {
			Paint Pnt = new Paint();
			Pnt.setAntiAlias(true);
			
			Pnt.setColor(Color.YELLOW);
			canvas.drawRect(100, 100, 200, 200, Pnt);
			
			Pnt.setColor(Color.BLUE);
			//canvas.restore();
			canvas.rotate(30, 150, 150);
			canvas.drawRect(100, 100, 200, 200, Pnt);

		}

	}
}
